#ifndef RSUTRANSMGR_H
#define RSUTRANSMGR_H

#include <QObject>
#include "rsuctrl.h"

class RsuTransMgr: public QObject
{
    Q_OBJECT

public:
    explicit RsuTransMgr(RsuCtrl *pRsuCtrl, QObject *parent = 0): QObject(parent)
    {
        m_pRsuCtrl=pRsuCtrl;
        m_nCurrentStep=0;
        m_pTransTimer=new QTimer(parent);
        m_pTransTimer->setSingleShot(true);
        connect(m_pTransTimer, &QTimer::timeout,
                this, &RsuTransMgr::transTimeout);
    }

    virtual void start()=0;
    void stop()
    {
        m_pTransTimer->stop();
    }
    virtual void processRsuFrame(quint8 nFrameIndex, quint8 nFrameType, const QByteArray &frame)=0;

protected slots:
    virtual void transTimeout()=0;

protected:
    QTimer *m_pTransTimer;
    RsuCtrl *m_pRsuCtrl;
    int m_nCurrentStep;
};

#endif // RSUTRANSMGR_H
